<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script src="./js/jquery.js"></script>
    <meta name="Author" content="">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    <link rel="stylesheet" href="./css/reset.css">
    <link rel="stylesheet" href="./css/table.css">
    <title>雪豹通讯录</title>
    <style type="text/css">
        #header {
            display: flex;
            justify-content: space-between;
            width: 900px;
            height: 50px;
            margin: 0 50px;
            text-align: center;
        }

        #header .logoPic {
            width: 100px;
            height: 50px;
            background-image: url('./image/logo.png');
            background-repeat: no-repeat;
            background-position: center center;
            background-size: 100%;
        }

        #header .rightDiv {
            width: 800px;
            height: 50px;
        }

        #header .rightDiv p {
            font-weight: 600;
        }

        #content {
            position: relative;
            width: 900px;
            margin: 0 50px;
        }

        #content .nav {
            width: 900px;
            height: 500px;
        }


        #content .slide-wrap {
            position: absolute;
            right: -60px;
            width: 52px;
        }

        #slide {
            position: fixed;
            top: 10px;
            width: 50px;
            height: 510px;
            background: #f6faf9;
            border: 1px solid #ddd;
            border-radius: 5px;
        }

        #slide li {
            position: relative;
            width: 50px;
            height: 32px;
            line-height: 32px;
            text-align: center;
            font-size: 12px;
            z-index: 2;
            cursor: pointer;
        }

        #slide li:hover {
            background: #00A1D6;
            color: #fff;
        }

        #slide li.on {
            background: #00A1D6;
            color: #fff;
        }

        #slide li.blue {
            display: none;
            position: absolute;
            top: 0;
            background: #00A1D6;
            z-index: 1;
        }
    </style>
</head>

<body>
    <div id="header">
        <div class="logoPic"></div>
        <div class="rightDiv">
            <p style="font-size:18px">浙 江 雪 豹 服 饰 有 限 公 司 通 讯 录</p>
            <p style="font-size:14px;margin-top:5px">总机：0573-80709888 传真：0573-87123573 服务热线：400-887-1337</p>
        </div>
    </div>
    <div id="content">
        <table width='900' border="1">
            <tr class="nav zjb">
                <td>部门</td>
                <td>班组</td>
                <td>职称</td>
                <td>姓名</td>
                <td>外线</td>
                <td>内线</td>
                <td>手机</td>
                <td>市政网</td>
            </tr>
            <tr >
                <td rowspan='3' style='background-color: #ffffcc;'>总经办</td>
                <td rowspan='3'>办公室</td>
                <td>董事长</td>
                <td>张志彤</td>
                <td>80706966</td>
                <td>888/889</td>
                <td>——</td>
                <td>——</td>
            </tr>
            <tr>
                <td>总经理</td>
                <td>朱伟祥</td>
                <td>87265883</td>
                <td>898/899</td>
                <td>——</td>
                <td>——</td>
            </tr>
            <tr>
                <td>总经理秘书</td>
                <td>姚婷婷</td>
                <td>80706986</td>
                <td>891/897</td>
                <td>——</td>
                <td>——</td>
            </tr>
            <tr class="nav">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr class="nav">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr class="nav">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr class="nav">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr class="nav">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr class="nav">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr class="nav">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr class="nav">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr class="nav">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr class="nav">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr class="nav">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr class="nav">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr class="nav">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr class="nav">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr class="nav">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>

        </table>

        <!-- <div class="nav zjb">这是总经办B</div>
        <div class="nav">这是企管部</div>
        <div class="nav">这是人资部</div>
        <div class="nav">这是财务部</div>
        <div class="nav">这是直营部</div>
        <div class="nav">这是电商部</div>
        <div class="nav">这是信息部</div>
        <div class="nav">这是奥莱部</div>
        <div class="nav">这是裘皮部</div>
        <div class="nav">这是采购部</div>
        <div class="nav">这是销售部</div>
        <div class="nav">这是研发部</div>
        <div class="nav">这是生产部</div>
        <div class="nav">这是售后部</div>
        <div class="nav">这是品管部</div>
        <div class="nav">这是技术部</div> -->
        <div class="slide-wrap">
            <div id="slide">
                <ul>
                    <li class="control">总经办</li>
                    <li class="control">企管部</li>
                    <li class="control">人资部</li>
                    <li class="control">财务部</li>
                    <li class="control">直营部</li>
                    <li class="control">电商部</li>
                    <li class="control">信息部</li>
                    <li class="control">奥莱部</li>
                    <li class="control">裘皮部</li>
                    <li class="control">采购部</li>
                    <li class="control">销售部</li>
                    <li class="control">研发部</li>
                    <li class="control">生产部</li>
                    <li class="control">售后部</li>
                    <li class="control">品管部</li>
                    <li class="control">技术部</li>
                    <li class="blue"></li>
                </ul>
            </div>
        </div>
    </div>
    <script type="text/javascript">

        // 导航条操作.
        (function () {
            var $control = $("#slide .control"),
                height = $control.height(),
                $nav = $("#content .nav"),
                length = $nav.length,
                index = 0,
                $blue = $("#slide .blue"),
                mark = true;
            // slide的点击跳转.
            $control.click(function () {
                mark = !mark;
                var This = this;
                index = $(this).index();
                // 替换样式.
                $(this).addClass("on").siblings().removeClass("on");
                // 跳转.
                $("body,html").stop().animate({ //会执行两次
                    "scrollTop": $nav.eq(index).offset().top + "px"
                }, 300);
                // 小块跟随.
                $blue.show().stop().animate({
                    top: height * index + "px"
                }, 300, function () {
                    $(this).hide();
                    // 跳转结束让开关开启
                    mark = !mark;
                });
            });
            // 页面滚动,让slide跟随.
            $(window).scroll(function () {
                // 点击跳转时不用检测.
                if (mark) {
                    for (var i = 0; i < length; i++) { //检测滚轮高度
                        if ($nav.eq(i).offset().top > $(this).scrollTop()) { // 让上一个control 显示.
                            index = i - 1;
                            if (index < 0) { //i=0时.  不显示.
                                index = 0;
                                $control.removeClass("on");
                            } else { //当i>=1时. 才开始显示.
                                $control.eq(index).addClass("on").siblings().removeClass("on");
                                // $blue 同步.
                                $blue.css("top", height * index + "px");
                            }

                            break; //检测到一个就退出.
                        }
                    }
                    // 最后一个.
                    if ($nav.last().offset().top < $(this).scrollTop()) {
                        $control.last().addClass("on").siblings().removeClass("on");
                        // $blue 同步.
                        $blue.css("top", (length - 1) * index + "px");
                    }
                }
            })
        })();
    </script>
</body>

</html>